<link rel="stylesheet" href="<?php echo $this->baseUrl("/media/css/prettyPhoto.css")?>" type="text/css" />

<!-- START OF WRAPPER -->
  <div class="view_banner" style="display:none"></div>
  <!-- START OF FULL_WIDTH_HOME -->
  <div class="full_width_home"> 
    
    <!-- START OF BREADCRUMB --><!-- END OF BREADCRUMB -->
    
    <h2>&nbsp;</h2>
    <h2><?php echo ucwords($this->planUsername) ?></h2>
    <!-- START OF ONE THIRD -->
    <div class="onethird">
      <h6><strong>Funding Required:</strong><?php if($this->data->funding_required) echo '£'.$this->data->funding_required ?></h6>
      <h6><strong>Sector:</strong> <?php echo ucwords(str_replace('_', ' ', $this->data->your_industry)) ?>, </h6>
    </div>
    <!-- END OF ONE THIRD --> 
    
    <!-- START OF ONE THIRD -->
    <div class="onethird">
      <h6><strong>Online Location:</strong> <?php echo ucwords(str_replace('_', ' ', $this->data->your_location)) ?> </h6>
      <h6><strong>Stage:</strong> <?php echo ucwords(str_replace('_', ' ', $this->data->business_state)) ?></h6>
    </div>
    <!-- END OF ONE THIRD --> 
    
    <!-- START OF ONE THIRD LAST -->
    <div class="onethirdlast"> <br />
      <!-- START OF HIGHLIGHT BUTTON BLUE -->
      <div class="highlight_button_blue"> <a href="<?php echo $this->baseUrl('/bbling/index/add-list/id/'.$this->data->id)?>">Add to Shortlist</a> </div>
      <!-- END OF HIGHLIGHT BUTTON BLUE --><!-- START OF HIGHLIGHT BUTTON BLUE -->
      <div class="highlight_button_blue"><a target="_new" href="<?php echo $this->baseUrl('/bbling/pdf/create-pdf/id/'.$this->data->id.'/Business and Bling')?>">Save Plan as PDF</a> </div><br /><br /><br />
     
       <div class="highlight_button_pink"><a href="#inline-1" rel="prettyPhoto" >Contact</a>
        <div id="inline-1" class="hide" style="display:none">
          <p>Great, we're glad you found something interesting. The business owner would like to be contacted by email. Their email is:</p>
          <p><?php echo 'xxxxxx130@163.com'; //echo $this->data->user_email;  ?></p>
        </div>
      </div>
      
      <div class="highlight_button_pink"> <a target="_new" href="<?php echo $this->baseUrl('/bbling/index/search')?>">Back to Search</a> </div><br />
      <!-- END OF HIGHLIGHT BUTTON BLUE --> 
      
    </div>
    <!-- END OF ONE THIRD LAST --> 
    <!-- START OF LEFT COLUMN --><!-- END OF LEFT COLUMN --> 
    
    <!-- START OF RIGHT COLUMN --><!-- END OF RIGHT COLUMN --> 
    
    <!-- END OF FULL -->
    
    <?php $userdata = $this->data->getData();?>
     <input name="id" type="hidden" value="<?php echo $userdata['id'] ?>" />
    <!-- START OF QUOTE -->
    <div class="quote"> <?php echo stripslashes($userdata['one_line_pitch']); ?> </div>
    <!-- END OF QUOTE --> 
    
    <!-- THIS IS HR -->
    <div class="hr"></div>
    
    <!-- *************************************************************************
    ***********************  START OF TABBED AREA  *******************************
    ************************************************************************** -->
    
    <ul class="tabs">
      <li><a href="#tab1">Executive Summary</a></li>
      <li><a href="#tab2">Products and Services</a></li>
      <li><a href="#tab3">Market Plan</a></li>
      <li><a href="#tab4">Financial Plan</a></li>
    </ul>
    
    <!-- START OF TAB CONTAINER -->
    <div class="tab_container"> 
      
      <!-- ************  START OF TABBED CONTENT AREA 1  ************* --> 
      
      <!-- START OF TAB 1 TAB CONTENT -->
      <div id="tab1" class="tab_content"> 
        
        <!-- START OF TAB LEFT -->
        <div class="tab_left">
         <h4>Company Summary</h4>
          <p><?php echo stripslashes($userdata['company_summary']); ?></p>
          <h4>Product Summary</h4>
          <p><?php echo stripslashes($userdata['product_summary']);?></p>
          <h4>Marketing Summary</h4>
          <p><?php echo stripslashes($userdata['marketing_summary']); ?></p>
          <h4>Financial Summary</h4>
          <p><?php echo stripslashes($userdata['financial_summary']); ?></p>
        </div>
        <!-- END OF TAB LEFT --> 
        
        <!-- START OF TAB RIGHT -->
        <!-- END OF TAB RIGHT --> 
      </div>
      <!-- END OF TAB 1 TAB CONTENT --> 
      
      <!-- ************  START OF TABBED CONTENT AREA 2  ************* --> 
      
      <!-- START OF TAB 2 TAB CONTENT -->
      <div id="tab2" class="tab_content"> 
        
        <!-- START OF TAB LEFT -->
        <div class="tab_left">
          <h4>Competitors</h4>
          <p><?php echo stripslashes($userdata['competitors']); ?></p>
          <h4>Product Overview</h4>
          <p><?php echo stripslashes($userdata['product_overview']); ?></p>
          <h4>Your Edge</h4>
          <p><?php echo stripslashes($userdata['your_edge']); ?></p>
          <h4>Product Summary</h4>
          <p><?php echo stripslashes($userdata['product_summary']); ?></p>
        </div>
        <!-- END OF TAB LEFT --> 
        
        <!-- START OF TAB RIGHT -->
        <!-- END OF TAB RIGHT --> 
      </div>
      <!-- END OF TAB 2 TAB CONTENT --> 
      
      <!-- ************  START OF TABBED CONTENT AREA 3  ************* --> 
      
      <!-- START OF TAB 3 TAB CONTENT -->
      <div id="tab3" class="tab_content"> 
        
        <!-- START OF TAB LEFT -->
        <div class="tab_left">
          <h4>Market Overview</h4>
          <p><?php echo stripslashes($userdata['market_overview']); ?></p>
          <h4>Market Needs</h4>
          <p><?php echo stripslashes($userdata['market_needs']); ?></p>
          <h4>Marketing Overview</h4>
          <p><?php echo stripslashes($userdata['marketing_overview']); ?></p>
          <h4>Positioning</h4>
          <p><?php echo stripslashes($userdata['positioning']); ?></p>
          <h4>Pricing</h4>
          <p><?php echo stripslashes($userdata['pricing']); ?></p>
          <h4>Promotion</h4>
          <p><?php echo stripslashes($userdata['promotion']); ?></p>
        </div>
        <!-- END OF TAB LEFT --> 
        
        <!-- START OF TAB RIGHT -->
        <!-- END OF TAB RIGHT --> 
      </div>
      <!-- END OF TAB 3 TAB CONTENT --> 
      
      <!-- ************  START OF TABBED CONTENT AREA 4  ************* --> 
      
      <!-- START OF TAB 4 TAB CONTENT -->
      <div id="tab4" class="tab_content"> 
        
        <!-- START OF TAB LEFT -->
        <div class="tab_left">
          <h4>Starting Balance</h4>
          <p><?php echo stripslashes($userdata['starting_balance']); ?></p>
          <?php if (count($this->balanaceDatas)):?>
          <p>
          <div id="financial_table">
            <?php foreach($this->balanaceDatas as $key => $items): ?>
            <?php if($key == 0):?>
            <?php $keys = array_keys($items); ?>
            <div class="financial_table_row" id="financial_table_row00">
              <?php foreach( $keys as $item ): ?>
              <div class="financial_table_row_cell"><?php echo ucwords(str_replace('_', ' ', $item)) ?></div>
              <?php endforeach; ?>
            </div>
            <?php endif;?>
            <div class="financial_table_row">
              <?php foreach($items as $key2 => $item ): ?>
              <div class="financial_table_row_cell"><?php echo $item ?></div>
              <?php endforeach; ?>
            </div>
            <?php endforeach; ?>
          </div>
          </p>
          <?php endif;?>
          <div id="financial_plan_chart_investor"></div>          
        </div>
        <!-- END OF TAB LEFT --> 
        
        <!-- START OF TAB RIGHT -->
        <!-- END OF TAB RIGHT --> 
      </div>
      <!-- END OF TAB 4 TAB CONTENT --> 
      
    </div>
    <!-- END OF TAB CONTAINER --> 
    
    <!-- THIS IS HR -->
    <div class="hr"></div>
    <h5>Management Team</h5>
    <div id='cv_download_container'>
      <?php if (count($this->cv_download_arr)) {?>
      <?php foreach ($this->cv_download_arr as $key => $value){?>
      <div class='cv_download_single'>
        <p> <a href="<?php echo $this->baseUrl('/bbling/index/cv-files-download');?>?<?php echo trim($value);?>"> <img src="<?php echo $this->baseUrl('/media/')?>img/upload_cv_image_.jpg" width="90" height="90" alt="staff 4" /> </a> </p>
        <p> <?php echo $this->cv_download_owner_name[$key];?></p>
        <p><a href="<?php echo $this->baseUrl('/bbling/index/cv-files-download');?>?<?php echo $value;?>">Download CV</a></p>
      </div>
      <?php }?>
      <?php }?>
    </div>
    
    <!-- THIS IS HR -->
    <div class="hr"></div>
    <p> 
      <!-- THIS IS HR --> 
      <!-- START OF COMMENT WRAPPER --><!-- END OF COMMENT WRAPPER --> 
    </p>
  </div>
  <!-- END OF FULL WIDTH HOME --> 
  
<!--</div>
--><!-- END OF WRAPPER -->

<!-- BELLOW IS A HIDDEN SPAN TO STORE THE URL TO GET THE BALANCE DATA --> 
<span id="financial_plan_blance_data_url" style="display:none;"><?php echo $this->baseUrl('/bbling/index/ajax-get-balanace-data')?></span>


<?php $paypalUrl = $this->paypalAccount == 'xxxxxx_1311918233_biz@gmail.com'?'www.sandbox.paypal.com':'www.paypal.com'?>
<form name="_xclick" action="https://<?php echo $paypalUrl?>/cgi-bin/webscr" method="post" id="paypal_form">
  <input type="hidden" name="cmd" value="_xclick">
  <input type="hidden" name="business" value="<?php echo $this->paypalAccount?>">
  <input type="hidden" name="item_name" value="For Search">
  <input type="hidden" name="currency_code" value="GBP">
  <input type="hidden" name="custom" value="<?php echo $this->user->confirm_key?>">
  <input type="hidden" name="amount" value="<?php echo $this->paypalFee?>">
  <input type="hidden" name="notify_url" value="<?php echo $this->fullBasePath.'/bbling/index/paypal-notify'?>" />
  <input type="hidden" name="return" value="<?php echo $this->fullBasePath.'/' ?>">
</form>
<script type="text/javascript">
	function submitPaypalForm(){
		document.getElementById('paypal_form').submit();
	}
</script>


<!-- load the google chart api -->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" charset="utf-8">
function financial_plan_chart_draw(){
	//initial
    var data_from_url = $('#financial_plan_blance_data_url').html();
    var div_id = 'financial_plan_chart_investor';

    /*
    var url = document.URL;
        url = url.split('/');
    var id = url[url.indexOf('id')+1]; //user id
    */

    var id = $('input[name=id]').val();
    //get data
	$.ajax({
	    type: "POST",
	    url: data_from_url,
	    data: "id="+id,
	    success: function(chart_data){
	    		/* DRAW THE GOOGLE CHART*/
	    		var items = eval(chart_data);
	    		var data = new google.visualization.DataTable();
	    	    data.addColumn('string', 'Month');
	    	    data.addColumn('number', 'Sales');
	    	    data.addColumn('number', 'Expenses');
	    	    data.addRows(12);
	    	    
	    	    for(var i=0; i<items.length; i++){
	    	    	var item = null;
	    	    	item = eval(items[i]);
	    	    	data.setValue(i, 0, item['month']);
	    	    	data.setValue(i, 1, parseInt(item['sales']));
	    	    	data.setValue(i, 2, parseInt(item['expenses']));
	    	    }
	    	    
	    	    var options = {width: 800, height: 240, title: 'Company Performance',
	    	            hAxis: {title: 'Year', titleTextStyle: {color: 'red'}},
	    	            colors:['#417CD6','#A41A56']
	    	    };
	    	    
	    	    var chart1 = new google.visualization.ColumnChart(document.getElementById(div_id));
	    	    chart1.draw(data, options);
	    	}
	});
}

google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(function(){	
	  financial_plan_chart_draw();
	  
});

</script>
<script type="text/javascript"> 
$(".chzn-select").chosen(); 

$("a[rel^='prettyPhoto']").prettyPhoto({
	theme:'light_square',
	showTitle: true
});
</script> 

